package com.team.weigou.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Toast;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.team.weigou.R;

import de.hdodenhof.circleimageview.CircleImageView;

/**
 * Created by ZJ on 2015/7/6 0006.
 */
public class MyFragment extends Fragment implements OnClickListener {
    @ViewInject(R.id.login_img)
    private CircleImageView login_img;
    @ViewInject(R.id.unlogin_btn)
    private Button unlogin_btn;
    @ViewInject(R.id.unlogin_lin)
    private LinearLayout unlogin_lin;
    @ViewInject(R.id.shopcar_rel)
    private RelativeLayout shopcar_rel;
    @ViewInject(R.id.unlogin_rel1)
    private LinearLayout unlogin_rel1;
    @ViewInject(R.id.unlogin_rel2)
    private LinearLayout unlogin_rel2;
    @ViewInject(R.id.unlogin_rel3)
    private LinearLayout unlogin_rel3;
    @ViewInject(R.id.unlogin_rel4)
    private LinearLayout unlogin_rel4;
    @ViewInject(R.id.unlogin_rel5)
    private LinearLayout unlogin_rel5;
    @ViewInject(R.id.unlogin_rel6)
    private LinearLayout unlogin_rel6;
    @ViewInject(R.id.unlogin_rel7)
    private LinearLayout unlogin_rel7;
    @ViewInject(R.id.unlogin_rel8)
    private LinearLayout unlogin_rel8;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_my_layout,null);
        ViewUtils.inject(this, view);
        return view;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.shopcar_rel:
                Toast.makeText(getActivity(), "购物车还没写完呢！", Toast.LENGTH_SHORT).show();
                break;
            case R.id.login_img:
            case R.id.unlogin_btn:
            case R.id.unlogin_lin:
            case R.id.unlogin_rel1:
            case R.id.unlogin_rel2:
            case R.id.unlogin_rel3:
            case R.id.unlogin_rel4:
            case R.id.unlogin_rel5:
            case R.id.unlogin_rel6:
            case R.id.unlogin_rel7:
            case R.id.unlogin_rel8:
                Toast.makeText(getActivity(), "您还未登陆", Toast.LENGTH_SHORT).show();
                break;

        }
    }
}
